from base.util.iterator.impl.IteratorImpl import IteratorImpl


def iterator(elements):
    return IteratorImpl(elements)


def step(it, steps):
    for i in range(steps):
        if not it.hasNext():
            return i
        it.next()
    return steps
